# !/usr/bin/env python
# -*-coding:utf-8 -*-
"""
# Author     ：hu_cl
# Date       ：2022/3/8 9:10
# File       : ti_task_restart.py
# Description： 解决内存占用问题
"""
import time
import os

import schedule as schedule


def job():
    schedule.every().days.at("1:00").do(main)
    while True:
        schedule.run_pending()  # 运行所有可以运行的任务
        time.sleep(10)


def main():
    code = os.system('supervisorctl restart all')
    if code == 0:
        print('执行任务成功')
    else:
        print('执行失败')


if __name__ == '__main__':
    job()
